<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>TCL_EvalStrTK_EvalStr</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 16/12/2005</div>
    <p>
      <b>TCL_EvalStr</b> - Evaluate a string whithin the tcl/tk
  interpreter</p>
    <p>
      <b>TK_EvalStr</b> - Evaluate a string whithin the tcl/tk
  interpreter (obsolete)</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>TCL_EvalStr(str [,interp])</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>str</b>
        </tt>: string or vector of strings, contains the tcl/tk
          instructions</li>
      <li>
        <tt>
          <b>interp</b>
        </tt>: optional character string parameter. Name of the slave tcl
          interpreter in which the operation has to be performed. If not
          provided, it defaults to the main tcl interpreter created by
          Scilab.</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>This routine allows to evaluate tcl/tk instructions with the tcl/tk
    interpreter launched with Scilab (when the <tt>
        <b>interp</b>
      </tt> parameter
    is not given), or in a slave interpreter.</p>
    <p>When tcl/tk support is enabled in Scilab, you can evaluate tcl/tk
    expression from Scilab interpreter. In fact, Scilab launches a main tcl/tk
    interpreter. The Scilab instruction <tt>
        <b>TCL_EvalStr</b>
      </tt> can be used
    to evaluate expressions without having to write tcl/tk instructions in a
    separated file (this capability is provided by
    <tt>
        <b>TCL_EvalFile</b>
      </tt>).</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>
//with one call
TCL_EvalStr(["toplevel .foo1"
   "label .foo1.l -text ""TK married Scilab !!!"""
   "pack .foo1.l"
   "button .foo1.b -text close -command {destroy .foo1}"
   "pack .foo1.b"])

//step by step (debugging)
TCL_EvalStr("toplevel .foo2");
// creates a toplevel TK window. 
TCL_EvalStr("label .foo2.l -text ""TK married Scilab !!!""");
// create a static label
TCL_EvalStr("pack .foo2.l");
// pack the label widget. It appears on the screen.
text="button .foo2.b -text close -command {destroy .foo2}";
TCL_EvalStr(text);
TCL_EvalStr("pack .foo2.b");

//kill the windows by program
TCL_EvalStr("destroy .foo1");
TCL_EvalStr("destroy .foo2");
 
//with one call, and in a slave interpreter
TCL_CreateSlave('TCLSlave');
TCL_EvalStr('set test ""in Slave TCL Interp""','TCLSlave');
TCL_GetVar('test','TCLSlave')

TCL_DeleteInterp('TCLSlave')
</pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="ScilabEval.htm">
        <tt>
          <b>ScilabEval</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="TK_EvalFile.htm">
        <tt>
          <b>TCL_EvalFile</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="TCL_GetVar.htm">
        <tt>
          <b>TCL_GetVar</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="TCL_SetVar.htm">
        <tt>
          <b>TCL_SetVar</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="TCL_ExistVar.htm">
        <tt>
          <b>TCL_ExistVar</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="TCL_UnsetVar.htm">
        <tt>
          <b>TCL_UnsetVar</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="TCL_UpVar.htm">
        <tt>
          <b>TCL_UpVar</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p>Allan CORNET</p>
  </body>
</html>
